<script setup lang="ts">
import { ref } from 'vue';

  const foods=ref(['饺子','油条','烤鱼','烤鸡'])
  const obj = ref({
  name: '张三',
  age: 18
})
</script>


<template>
  <p v-for="(item,index) in foods" :key="item">{{ index+1 }}{{ item }}</p>
  <ol>
    <li v-for="item in foods" :key="item">
      {{ item }}
    </li>
  </ol>
  <ol v-for="item in Array.from({length:5})">
    <li>测试</li>
  </ol>
  <ol v-for="item in 5">
    <li>
      测试
    </li>
  </ol>
  <ul>
      <!-- 支持对象循环遍历，遍历对象的键值对，了解即可 -->
      <li v-for="(value, key, index) in obj">
        {{ index }} {{ key }} : {{ value }}
      </li>
    </ul>
</template>

<style>
  .isActive{
    color: red;
  }
</style>
